function [stru_grid,stru_up_rigid,stru_down_rigid]=modify_grid(stru_up_rigid,stru_down_rigid)
fgrid=fopen('grid_101.bdf','r');
i=1;
stru_grid=zeros(0,4);
while feof(fgrid)==0
    entry=fgetl(fgrid);
    len=length(entry);
    stru_grid(i,1)=sscanf(entry(9:16),'%d');
    stru_grid(i,2)=sscanf(entry(25:32),'%f');
    stru_grid(i,3)=sscanf(entry(33:40),'%f');
    stru_grid(i,4)=sscanf(entry(41:len),'%f');
    i=i+1;
end
fclose(fgrid);

for i=1:size(stru_up_rigid,1)
    stru_up_rigid(i,2:4)=stru_grid(stru_grid(:,1)==stru_up_rigid(i,1),2:4);
end
for i=1:size(stru_down_rigid,1)
    stru_down_rigid(i,2:4)=stru_grid(stru_grid(:,1)==stru_down_rigid(i,1),2:4);
end
stru_grid=sortrows(stru_grid,1);
end